package com.jake.spring.boot.csv.handler;

import com.jake.spring.boot.csv.exception.CSVTempCreateException;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyControllerExceptionHandler {

    @ExceptionHandler(CSVTempCreateException.class)
    @ResponseStatus(HttpStatus.OK)
    public String handleCSVTempCreateException(CSVTempCreateException ex) {
        return ex.getMessage();
    }
}
